# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

pkgname=rtl-sdr-lms
_pkgname=lms-rtl-sdr
pkgver=r343.b459a70
_commit=b459a705f30f2cc8b21362aab7f3cf7a32ef5981
pkgrel=1
pkgdesc='Support LimeSuite devices under the rtl-sdr API'
arch=('loong64' 'x86_64')
url='https://github.com/pothosware/lms-rtl-sdr'
license=('GPL3')
depends=('limesuite')
makedepends=('cmake')
provides=('rtl-sdr')
conflicts=('rtl-sdr')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$_commit.tar.gz")
sha512sums=('691dfad977b089a83d883072aabe15ecb631958d9be8971947c13f8bf064613c0c3d080938772b92a1ec3e8f5b22d38be56ea553a1603f17f34f94dc38a2dcd1')

build() {
  mkdir -p $_pkgname-$_commit/build
  cd $_pkgname-$_commit/build

  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release

  make
}

package() {
  cd $_pkgname-$_commit/build

  make DESTDIR="$pkgdir" install
}

